import http from '@/utils/http.ts'
import type { loginResponseData, loginFormType, homeResponseData, logoutResponse } from '../types/loginType'
enum API {
    LOGIN_URL = '/login',
    USERINFO_URL = '/home',
    LOGOUT_URL = '/logout'
}

// 用户登陆
export const reqLogin = (data: loginFormType) => http.post<any, loginResponseData>(API.LOGIN_URL, data)

// 用户登陆成功请求
export const reqUserInfo = () => http.get<any, homeResponseData>(API.USERINFO_URL)

// 退出登陆
export const reqLogout = () => http.get<any, logoutResponse>(API.LOGOUT_URL)